#ifndef MENUVIEW_H
#define MENUVIEW_H

#include <QDialog>
#include "ui_menuview.h"

namespace Ui {
class menuview;
}

class menuview : public QDialog
{
    Q_OBJECT

public:
    explicit menuview(QWidget *parent = nullptr);
    ~menuview();

    //友元函数
    friend void getContent(menuview* s,std::string& content);

    int desk;

    //每个菜的剩余量
    int A1,A2,A3,A4,A5,A6,B1,B2,B3,B4,B5,B6;

    void soldout();

signals:
    void sitdown(std::string desknum);
    void SubmitOrder(std::string content1,std::string desknum);
    void Pay(uint64_t total,std::string desknum);
    void Callwaiter(std::string desknum);

public slots:
    //更改桌子状态的槽函数
    void slot_State(uint64_t desknum);

    void slot_Modify(int num);

private slots:
    void on_spinBox_2_valueChanged(int arg1);

    void on_spinBox_3_valueChanged(int arg1);

    void on_spinBox_4_valueChanged(int arg1);

    void on_spinBox_5_valueChanged(int arg1);

    void on_spinBox_6_valueChanged(int arg1);

    void on_spinBox_12_valueChanged(int arg1);

    void on_spinBox_11_valueChanged(int arg1);

    void on_spinBox_8_valueChanged(int arg1);

    void on_spinBox_9_valueChanged(int arg1);

    void on_spinBox_10_valueChanged(int arg1);

    void on_pushButton_2_clicked();

    void on_spinBox_1_valueChanged(int arg1);

    void on_spinBox_7_valueChanged(int arg1);

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_clicked();

private:
    Ui::menuview *ui;
    //用来获取已经选购的菜品的内容
    QLabel* label = new QLabel();
private:
    //每个菜品对应的个数和总金额
    int a1,a2,a3,a4,a5,a6,b1,b2,b3,b4,b5,b6;
    uint64_t total;
    std::string content;
    uint64_t status[8];     //每个桌子的状态--0表示空闲，1表示忙碌
    std::string desknum;    //获取桌号
};

#endif // MENUVIEW_H
